{extend name="base/main" /}
{block name="body"}
<link rel="stylesheet" href="/static/layui/css/layui.css">
<script src="/static/layui/layui.js"></script>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>课程管理 /专栏列表</h5>
        </div>
        <div class="ibox-content">
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="search-area" id="toggle" style="margin-bottom: 15px;">
                        <form class="form-horizontal m-t" action="{:url('Special/index')}" method="get">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">栏目名称：</label>
                                <div class="col-sm-2">
                                    <input name="title" type="text" class="form-control" >
                                </div>
                            </div>
                             <div class="form-group">
                                <label class="col-sm-2 control-label">所属分类：</label>
                                <div class="col-sm-2">
                                      <select name="subject_id" id=""  class="form-control">
                                           <option value="">请选择</option>
                                           {foreach $lost as $key=>$vo}
                                           <option value="{$vo.id}">{$vo.name}</option>
                                           {/foreach}
                                     </select>
                                </div>
                            </div>
                             <div class="form-group">
                                <label class="col-sm-2 control-label">是否显示：</label>
                                <div class="col-sm-2">
                                       <select name="is_show" id=""  class="form-control">
                                           <option value="">请选择</option>
                                           <option value="1">显示</option>
                                           <option value="2">不显示</option>
                                     </select>
                                </div>
                            </div>
                          <div class="form-group">
                                <label class="col-sm-2 control-label">有效时间：</label>
                                <div class="col-sm-4">
                                    <div class="layui-form-item">
                                       <div class="layui-inline">
                                        <div class="layui-input-inline" style="width: 200px;">
                                       <input type="text" name="pink_strar_time" id="test5" placeholder="2021-05-19" autocomplete="off" class="layui-input">
                                     </div>
                                      <div class="layui-form-mid">至</div>
                                    <div class="layui-input-inline" style="width: 200px;">
                                       <input type="text" name="pink_end_time" id="test5" placeholder="2021-06-18" autocomplete="off" class="layui-input">
                                    </div>
                                       </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-1">
                                    <button class="btn btn-primary btn-sm" type="submit">搜索</button>
                                    <a href="{:url('adv/index')}" class="btn btn-default btn-sm">撤销搜索</a>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="fixed-table-toolbar">
                        <div class="bars pull-left" style="margin-top:0px;">
                            <a href="javascript:void(0);" class="btn btn-sm btn-primary search-toggle"><i class="fa fa-search"></i>&nbsp;&nbsp;搜索</a>
                            <a href="{:url('Special/create')}" class="btn btn-sm btn-primary"><i class="fa fa-plus"></i>&nbsp;&nbsp;添加</a>
                            <a href="javascript:void(0);" class="btn btn-sm btn-primary confirm ajax-post" target-form="id" url="{:url('Special/remove')}"><i class="fa fa-close"></i>&nbsp;&nbsp;删除</a>
                            <a href="javascript:void(0);" class="btn btn-sm btn-primary confirm ajax-post" target-form="id" url="{:url('Special/state',['status'=>1])}"><i class="fa fa-check"></i>&nbsp;&nbsp;启用</a>
                            <a href="javascript:void(0);" class="btn btn-sm btn-primary confirm ajax-post" target-form="id" url="{:url('Special/state',['status'=>2])}"><i class="fa fa-ban"></i>&nbsp;&nbsp;禁用</a>
                        </div>
                    </div>
                    <div class="example-wrap">
                        <div class="example">
                            <table class="table table-hover">
                                <thead>
                                <tr>
                                    <th><input type="checkbox" class="i-checks check-all"></th>
                                    <th>ID</th>
                                    <th>专栏名称</th>
                                    <th>所属分类</th>
                                    <th>封面图</th>
                                    <th>首页推荐版块</th>
                                    <th>专题数量</th>
                                    <th>实际销量</th>
                                    <th>虚拟销量</th>
                                    <th>拼团状态</th>
                                    <th>排序</th>
                                    <th>是否显示</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {volist name="data" id="vo"}
                                <tr>
                                     <td><input type="checkbox" class="i-checks ids" name="id[]" value="{$vo.id}"/></td>
                                    <td>{$vo.id}</td>
                                    <td>{$vo.title}</td>
                                    <td>{$vo.subject}</td>
                                    <td><img src="{$vo.image}" width="100px" height="100px" alt=""></td>
                                    <td> <?php foreach( $vo["recommend_name"] as $v ){ ?>
                                      <div>
                                      <button data-toggle="dropdown" class="btn btn-success btn-xs dropdown-toggle">{$v}</button>
                                      </div>
                                      <?php }?></td>
                                    <td>{$vo.sum}</td>
                                    <td>{$vo.sales}</td>
                                    <td>{$vo.fake_sales}</td>
                                    <td><?php if($vo['is_pink'] == 1){ ?>拼团开启
                                        <?php }else{ ?>拼团关闭
                                        <?php } ?></td></td>
                                    <td> <?php if($vo['sort'] == 1){ ?>显示
                                        <?php }else{ ?>不显示
                                        <?php } ?></td>
                                     <td>
                                        <?php if($vo['is_show'] == 1){ ?>
                                        <i class="fa fa-check text-navy"></i>
                                        <?php }else{ ?>
                                        <i class="fa fa-check fa-close"></i>
                                        <?php } ?>
                                    </td>
                                    <td>
                                     <div class="dropdown" style="display: inline-block;">
                                            <button data-toggle="dropdown" class="btn btn-success btn-xs dropdown-toggle">
                                                <i class="fa fa-chevron-down"></i>操作
                                            </button>
                                            <ul class="dropdown-menu m-t-xs">
                                                <li> <a href="{:url('Special/read',['id'=>$vo['id']])}" class="btn btn-info btn-xs"><i class="fa fa-paste"></i> 编辑专题 </a></li>
                                                 <li> <a href="{:url('Special/update',['id'=>$vo['id']])}" class="btn btn-info btn-xs"><i class="fa fa-paste"></i> 查看拼团</a></li>
                                                 <li> <a href="{:url('Special/getsho',['id'=>$vo['id']])}" class="btn btn-info btn-xs"><i class="fa fa-paste"></i>推荐至首页</a></li>
                                                 <li> <a href="{:url('Special/loe',['id'=>$vo['id']])}" class="btn btn-info btn-xs"><i class="fa fa-paste"></i> 拼团设置</a></li>
                                                <li><a href=""> <a href="javascript:void(0);" class="btn btn-danger btn-xs confirm tabledel ajax-post-a" target-form="id" data-id="{$vo.id}" url="{:url('Special/remove',['id'=>$vo['id']])}"><i class="fa fa-trash"></i> 删除专题 </a></li>
                                            </ul>
                                       </div>
                                    </td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </div>


                    </div>
                </div>
            </div>
            {$list->render()|raw}
        </div>

    </div>

</div>
    <script>
layui.use('laydate', function(){
  var laydate = layui.laydate;

  //日期时间选择器
  laydate.render({
    elem: '#test5'
    ,type: 'datetime'
  });
});
</script>
{/block}
